import request from '../methods.js'
let config = {ShowLoading : true,ShowMsg : true,getAllData : false,new:false,system:false,store:false} 
export default {
	// 获取产品列表
	GetProductList:async function(prams){
		let data={...config}
		data.store=true
		return await request.Post('/api/v1/Product/getall',prams,data)
	},
	// 获取产品详情
	getproductInfo:async function(prams){
		let data={...config}
		data.store=true
		return await request.Get('/api/v1/Product/getproductInfo',prams,data)
	},
	// 添加收藏/足迹
	InsertHistory:async function(prams){
		let data={...config}
		data.new=true
		return await request.Get("/api/v1/History/InsertHistory",prams,data)
	},
	// 添加购物车
	InsertShoppingCart:async function(prams){
		let data={...config}
		data.new=true
		return await request.Post("/api/v1/ShoppingCart/InsertShoppingCart",prams,data)
	},
	// 获取购物车
	GetShoppingCart:async function(prams){
		let data={...config}
		data.new=true
		return await request.Post('/api/v1/ShoppingCart/GetShoppingCart',prams,data)
	},
	// 删除购物车
	ShoppingCartDelete:async function(prams){
		let data={...config}
		data.new=true
		return await request.Post('/api/v1/ShoppingCart/ShoppingCartDelete',prams,data)
	},
	// 获取收藏状态
	IsEnHistory:async function (prams){
		let data={...config}
		data.new=true
		data.getAllData=true
		return await request.Get('/api/v1/History/IsEnHistory',prams,data)
	},
	// 获取收藏历史足迹
	GetHistory:async function(prams){
		let data={...config}
		data.new=true
		return await request.Post('/api/v1/History/GetHistory',prams,data)
	},
	// 删除收藏足迹
	HistoryDelete:async function(prams){
		let data={...config}
		data.new=true
		return await request.Get('/api/v1/History/HistoryDelete',prams,data)
	}
}